package org.jsola.hr.web;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jsola.core.Page;
import org.jsola.core.Result;
import org.jsola.hr.dto.ProductTypeAddDTO;
import org.jsola.hr.dto.ProductTypeUpdateDTO;
import org.jsola.hr.query.ProductTypeQuery;
import org.jsola.hr.vo.ProductTypeListVO;
import org.jsola.hr.vo.ProductTypeVO;

import java.util.List;

/**
 * 产品分类
 *
 * @author zhr
 */
@Api(tags = "hr-产品分类")
public interface IProductTypeControllerAPI {

    /**
     * 新增产品分类
     * @param productTypeAddDTO 产品分类新增实体
     * @return 产品分类展示对象
     */
    @ApiOperation(value = "新增产品分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productTypeAddDTO", dataType = "ProductTypeAddDTO", value = "新增产品分类", paramType = "body")
    })
    Result<ProductTypeVO> save(ProductTypeAddDTO productTypeAddDTO);


    /**
     * 修改产品分类
     * @param productTypeUpdateDTO 产品分类
     * @return 更新数量
     */
    @ApiOperation(value = "修改产品分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productTypeUpdateDTO", dataType = "ProductTypeUpdateDTO", value = "修改产品分类", paramType = "body")
    })
    Result<Integer> update(ProductTypeUpdateDTO productTypeUpdateDTO);




    /**
     * 删除单个产品分类，彻底删除
     * @param productTypeId 产品分类id
     * @return 删除数量
     */
    @ApiOperation(value="删除单个产品分类，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productTypeId", dataType = "String", value = "产品分类id", paramType = "path")
    })
    Result<Integer> delete(String productTypeId);


    /**
     * 批量删除产品分类，彻底删除
     * @param productTypeIds 产品分类id集合
     * @return 删除数量
     */
    @ApiOperation(value = "批量删除产品分类，彻底删除")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productTypeIds", dataType = "String[]", value = "产品分类id数组", paramType = "body" ,allowMultiple = true)
    })
    Result<Integer> deleteBatch(String[] productTypeIds);


    /**
     * 根据产品分类id查询产品分类详情
     * @param productTypeId 产品分类id
     * @return 产品分类详情
     */
    @ApiOperation(value="根据产品分类id查询产品分类详情")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productTypeId", dataType = "String", value = "产品分类id", paramType = "path")
    })
    Result<ProductTypeVO> findById(String productTypeId);


    /**
     * 查询产品分类
     * @param productTypeQuery 产品分类查询参数
     * @return page
     */
    @ApiOperation(value="查询产品分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productTypeQuery", dataType = "ProductTypeQuery", value = "产品分类查询参数", paramType = "query")
    })
    Result<List<ProductTypeListVO>> listAll(ProductTypeQuery productTypeQuery);


     /**
     * 分页查询产品分类
     * @param productTypeQuery 产品分类查询参数
     * @return page
     */
    @ApiOperation(value="分页查询产品分类")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "productTypeQuery", dataType = "ProductTypeQuery", value = "产品分类查询参数", paramType = "query")
    })
    Result<Page<ProductTypeListVO>> page(ProductTypeQuery productTypeQuery);

    /**
     * 查询租户下产品分类
     * @return 租户下产品分类
     */
    Result<List<ProductTypeListVO>> selectBySite();
}

